package com.kin.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.SessionAttributes;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

import com.kin.service.IPageService;
import com.kin.service.IRoleService;
import com.kin.service.IUserService;
import com.kin.tools.IToolsService;

/**
 * 页面转向Controller
 * @author lauvinson
 * @time 2017年7月14日08:48:20
 */
@Controller("pageJumpController")
@SessionAttributes("User")
public class PageJumpController {
	
	@Resource
	private IUserService userService;//用户Service
	
	@Resource
	private IRoleService roleService;//角色权限Service
	
	@Resource
	private IPageService pageService;//页面Service
	
	@Resource
	private IToolsService toolsService;//工具Service
	
	/**
	 * 请求登录页面
	 * @param model Model
	 * @return sign/sign_in
	 */
	@RequestMapping("/signIn")
	public String sign_in(Model model)
	{
		return "sign/sign_in";
	}
	
	/**
	 * 请求根页面
	 * @param model Model
	 * @param attr Attr
	 * @return redirect:index
	 */
	@RequestMapping(value={"/home","/"})
	public String home(Model model ,RedirectAttributes attr)
	{
		return "redirect:/index.jsp";
	}
	
	/**
	 * 请求管理页面
	 * @param model Model
	 * @return manage/manage
	 */
	@RequestMapping("/manage")
	public String manage(Model model)
	{
		return "manage/manage";
	}
	
	
	/**
	 * 请求角色权限信息页面
	 * @param model Model
	 * @return manage/roleTable
	 */
	@RequestMapping(value="/roleTable")
	public String roleTable(Model model)
	{
		return "manage/roleTable";
	}
	
}
